package com.soft.javase.day07.balancenotenoughexception;

/**
 * @author yzh
 * @desc TODO
 * @date 2025/4/26
 */
public class ExceptionTest {
    public static void main(String[] args) {
        Account acc = new Account(1L, 5000.0);
        System.out.println("取钱前："+acc);

        try {
            acc.withdraw(6000);
        } catch (BalanceNotEnoughException e) {
            System.out.println(e.getMessage());
        }finally {
            System.out.println("取钱后："+acc);
        }
    }
}
